From 85d8b3f999b6ec57823ff130fbaf64dcee5ae98e Mon Sep 17 00:00:00 2001 From: robertl Date: Fri, 16 Feb 2007 00:31:48 +0000 Subject: [PATCH] Don't make "smart" (typ. geocaching) names the default. -N now silently eaten. Add -S. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@2673 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/defs.h | 4 ++-- gpsbabel/garmin.c | 6 +++--- gpsbabel/kml.c | 11 ++++++++--- gpsbabel/magproto.c | 2 +- gpsbabel/main.c | 21 +++++++++++++++++++++ gpsbabel/util.c | 2 +- 6 files changed, 36 insertions(+), 10 deletions(-) diff --git a/gpsbabel/defs.h b/gpsbabel/defs.h index 8262323ea..0c8e081a5 100644 --- a/gpsbabel/defs.h +++ b/gpsbabel/defs.h @@ -151,8 +151,8 @@ typedef struct { gpsdata_type objective; unsigned int masked_objective; int verbose_status; /* set by GUI wrappers for status */ - int no_smart_icons; - int no_smart_names; + int smart_icons; + int smart_names; cet_cs_vec_t *charset; char *charset_name; inifile_t *inifile; diff --git a/gpsbabel/garmin.c b/gpsbabel/garmin.c index f43b5a18f..69d906a40 100644 --- a/gpsbabel/garmin.c +++ b/gpsbabel/garmin.c @@ -572,13 +572,13 @@ waypt_write_cb(GPS_PWay *way) } /* - * If we're not using smart icons, try to put the cache info in the + * If we're using smart names, try to put the cache info in the * description. */ const char * get_gc_info(waypoint *wpt) { - if (global_opts.no_smart_icons) { + if (global_opts.smart_names) { if (wpt->gc_data.type == gt_virtual) return "V "; if (wpt->gc_data.type == gt_unknown) return "? "; if (wpt->gc_data.type == gt_multi) return "Mlt "; @@ -636,7 +636,7 @@ waypoint_write(void) } way[i]->ident[sizeof(way[i]->ident)-1] = 0; - if (!global_opts.no_smart_icons && + if (global_opts.smart_names && wpt->gc_data.diff && wpt->gc_data.terr) { snprintf(obuf, sizeof(obuf), "%s%d/%d %s", get_gc_info(wpt), diff --git a/gpsbabel/kml.c b/gpsbabel/kml.c index 34c96ffb2..c544a041f 100644 --- a/gpsbabel/kml.c +++ b/gpsbabel/kml.c @@ -676,8 +676,13 @@ static void kml_waypt_pr(const waypoint *waypointp) else fputs(odesc, ofd); - if (!global_opts.no_smart_icons && - waypointp->gc_data.diff && waypointp->gc_data.terr) { + /* It's tempting to conditionalize this on smart_names, but + * KML is so robust that it makes sense to just always do + * this for geocaches. (Plus the convenience of being able + * to do a drag-n-drop into Earth without extra option is a + * win.) + */ + if (waypointp->gc_data.diff && waypointp->gc_data.terr) { if (waypointp->gc_data.placer) { char *p = xml_entitize(waypointp->gc_data.placer); fprintf(ofd, " by %s]]>", p); @@ -713,7 +718,7 @@ static void kml_waypt_pr(const waypoint *waypointp) kml_write_xml(-1, "\n"); kml_write_xml(-1, "\n"); - } else if (!global_opts.no_smart_icons && waypointp->gc_data.diff && waypointp->gc_data.terr) { + } else if (waypointp->gc_data.diff && waypointp->gc_data.terr) { char *is = kml_lookup_gc_icon(waypointp); kml_write_xml(1, "